home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / MotifApp / ch2 / Password2 / pwtest2.C < prev   
Encoding:
C/C++ Source or Header  |  1995-05-03  |  1.9 KB  |  68 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. ////////////////////////////////////////////////////////
  22. // pwtest2.C,
  23. ////////////////////////////////////////////////////////
  24.  
  25. #include <Xm/Xm.h>
  26. #include "Password.h"
  27.  
  28. #if (XlibSpecificationRelease>=5)
  29. void main ( int argc, char **argv )
  30. #else
  31. void main ( unsigned int argc, char **argv )
  32. #endif
  33. {
  34.     Widget       toplevel;
  35.     Display     *dpy;
  36.     XtAppContext app;
  37.     
  38.     // Initialize the Intrinsics
  39.     
  40.     XtToolkitInitialize();
  41.  
  42.     // Create an application context
  43.     
  44.     app = XtCreateApplicationContext();
  45.     
  46.     // Open a connection to the X server
  47.     
  48.     dpy = XtOpenDisplay ( app, NULL, NULL, 
  49.                          "Pwtest1", 
  50.                          NULL, 0, 
  51.                          &argc, argv );
  52.     
  53.     // Create a toplevel shell
  54.     
  55.     toplevel = XtAppCreateShell ( NULL, "Pwtest1", 
  56.                                  applicationShellWidgetClass,
  57.                                  dpy, NULL, 0 );
  58.     
  59.     Password *pw = new Password(toplevel, "password");
  60.     
  61.     // Realize all widgets and enter the main event loop
  62.     
  63.     XtRealizeWidget ( toplevel );
  64.     
  65.     XtAppMainLoop ( app );
  66. }
  67.  
  68.